package com.backend.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    /***
     * 全局的异常处理
     */
    @ExceptionHandler({Exception.class})
    public  Result myException(Exception ex){
        return  Result.fail (500,"出现异常",ex.getMessage());
    }
}